# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=getmail6
pkgver=6.18.9
pkgrel=1
pkgdesc="mail retriever with support for POP3, IMAP4 and SDPS"
url="https://getmail6.org/"
arch="noarch"
license="GPL-2.0-only"
checkdepends="py3-pytest"
makedepends="py3-setuptools"
depends="python3"
subpackages="$pkgname-doc"
source="https://github.com/getmail6/getmail6/archive/v$pkgver/getmail-$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD/build/lib" pytest -v test/test.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	mv "$pkgdir/usr/share/doc/getmail-$pkgver" "$pkgdir/usr/share/doc/$pkgname"
}

sha512sums="
dfeaebbca0c8766a16783d27171e65595d97a4b557943677dd7e7a66a9da8b49dfdbfb4aba9655ce3815ff6e2f991905317085b156ba6dbac841bb0fbb26c8b5  getmail-6.18.9.tar.gz
"
